<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 
 
<h:head>
        <link rel="StyleSheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/css/estilo.css" media="screen" />
        <link type="text/css" rel="stylesheet" href="#{facesContext.externalContext.requestContextPath}/css/tema/theme.css"/>
</h:head>
<body>	
	<h:form id="form"> 
	<p:panel  header="Cadastrar Vaga" style="width:790px" styleClass="pos">
	<p:panel id="pnlDV1" style="width:760px" styleClass="semBorda" header="DADOS GERAIS"> 
		<p:panelGrid id="pnlDV2" styleClass="semBorda" style="width:740px"> 
        <p:row>        
        	<p:column>Codigo da Vaga:</p:column>
        </p:row>`
        <p:row>        
        	<p:column colspan="3">CBO:</p:column>
        </p:row>
        <p:row>        
        	<p:column colspan="3">
        	     <p:inputText id="txCBO" size="100" disabled="true" value="#{MBVaga.beanVaga.cbo.descCBO}"/> 
        	     <p:commandButton title="Pesquisar" icon="ui-icon-search" oncomplete="pesqCBO.show()" />
        	</p:column>
        </p:row>
        <p:row>
        <p:column>Tipo da Vaga * </p:column>
        <p:column>Horario *</p:column>
        <p:column>Aceita Deficiente *</p:column>
        </p:row>
        <p:row>
            <p:column>
            	<p:selectOneMenu value="#{MBVaga.beanVaga.tipoVaga}">  
   					<f:selectItem itemLabel="Selecione..." itemValue="" />
	            	<f:selectItem itemLabel="Estágio" itemValue="E" />  
    	        	<f:selectItem itemLabel="Profissional" itemValue="p" />     
        		</p:selectOneMenu>
            </p:column>
   			<p:column>
   				<p:selectOneMenu value="#{MBVaga.beanVaga.horarioVaga}"> 
   					<f:selectItem itemLabel="Selecione..." itemValue="" /> 
	            	<f:selectItem itemLabel="Manhã" itemValue="MANHA" />  
    	        	<f:selectItem itemLabel="Tarde" itemValue="TARDE" /> 
        	    	<f:selectItem itemLabel="Noite" itemValue="NOITE" /> 
            		<f:selectItem itemLabel="Madrugada" itemValue="MADRUGADA" /> 
            		<f:selectItem itemLabel="FreeLacer" itemValue="FREELACER" />     
        		</p:selectOneMenu>
            </p:column>
   			<p:column>
   				<p:selectOneMenu value="#{MBVaga.beanVaga.aceitaDefVaga}"> 
   					<f:selectItem itemLabel="Selecione..." itemValue="" /> 
	            	<f:selectItem itemLabel="Sim" itemValue="S" />  
    	        	<f:selectItem itemLabel="Não" itemValue="N" />      
        		</p:selectOneMenu>
            </p:column>   		
        	</p:row>
            
            <p:row>
            	<p:column>Qtde de Vagas *</p:column>
            	<p:column>Qtde Candidatos a Receber *</p:column>
            	<p:column>Remuneração *</p:column>
           	</p:row>
   			<p:row>
   				<p:column> <p:inputText value="#{MBVaga.beanVaga.qtdeVaga}" size="10"/></p:column>
   			    <p:column><p:inputText value="#{MBVaga.beanVaga.numMaxCandVaga}" size="10"/></p:column>
   			    <p:column><p:inputText value="#{MBVaga.beanVaga.salarioVaga}" size="10"/></p:column>  
   			</p:row>
   			
   			<p:row>
   		         <p:column colspan="3">Descrição das atividades a serem exercidas* </p:column>
            </p:row>
            
           	<p:row>
   				<p:column colspan="3"><p:inputTextarea value="#{MBVaga.beanVaga.descAtivVaga}" rows="4" cols="120"/></p:column>   			
   			</p:row>   			
   		</p:panelGrid>
   		</p:panel>
   		
   		   		
   		<p:panel style="width:760px" header="DADOS BASICOS PARA ADMISSÃO"> 
		<p:panelGrid styleClass="semBorda" style="width:740px">
   			<p:row>
   			<p:column>Sexo *</p:column>
   			<p:column>Estado Civil *</p:column>
            <p:column>Necessita de CNH? *</p:column>
            <p:column>Faixa Etária *</p:column>            
            </p:row>
            
            <p:row>
   			<p:column>
   				<p:selectOneMenu value="#{MBVaga.beanVaga.sexoVaga}">  
	   				<f:selectItem itemLabel="Selecione..." itemValue="" />
            		<f:selectItem itemLabel="Feminino" itemValue="F" />  
            		<f:selectItem itemLabel="Masculino" itemValue="M" />     
        		</p:selectOneMenu>
        	</p:column>        	
        	<p:column>
        		<p:selectOneMenu value="#{MBVaga.beanVaga.estCivilVaga}">  
   					<f:selectItem itemLabel="Selecione..." itemValue="" />
	            	<f:selectItem itemLabel="Casado(a)" itemValue="CASADO" />  
    	        	<f:selectItem itemLabel="Solteiro(a)" itemValue="SOLTEIRO" /> 
        	    	<f:selectItem itemLabel="Separado(a)" itemValue="SEPARADO" /> 
            		<f:selectItem itemLabel="Divorciado(a)" itemValue="DIVORCIADO" />     
	        	</p:selectOneMenu>
	        </p:column>
   			<p:column>
   				<p:selectOneMenu value="#{MBVaga.beanVaga.CNHVaga}"> 
	   				<f:selectItem itemLabel="Selecione..." itemValue="" /> 
    	        	<f:selectItem itemLabel="Carro" itemValue="CARRO" />  
        	    	<f:selectItem itemLabel="Moto" itemValue="MOTO" /> 
            		<f:selectItem itemLabel="Carro e Moto" itemValue="CARROEMOTO" /> 
            		<f:selectItem itemLabel="Não Necessita" itemValue="NAONECESSITA" />    
	        	</p:selectOneMenu>
	       	</p:column>
	       	<p:column>
            	<p:selectOneMenu value="#{MBVaga.idade}"> 
	   				<f:selectItem itemLabel="Selecione..." itemValue="" /> 
    	        	<f:selectItem itemLabel="18 a 21 anos" itemValue="1" />  
        	    	<f:selectItem itemLabel="21 a 25 anos" itemValue="2" /> 
            		<f:selectItem itemLabel="25 a 35 anos" itemValue="3" /> 
            		<f:selectItem itemLabel="Acima de 35 anos" itemValue="4" /> 
	            	<f:selectItem itemLabel="Indiferente" itemValue="5" />     
    	    	</p:selectOneMenu>
    	    </p:column>	       	        		       	
   			</p:row>   		
   			</p:panelGrid>
   			</p:panel>
   			
   			<p:panel id="pnlct" style="width:760px" header="CONHECIMENTOS TECNOLOGICOS EXIGIDOS"> 
		       <p:panelGrid id="pnlct1" styleClass="semBorda" style="width:740px">
   			<p:row>
               <p:column colspan="4">
               CONHECIMENTO TECNOLOGICO
               <p:commandButton title="Pesquisar" icon="ui-icon-search" oncomplete="pesqCT.show()" />
               </p:column>
            </p:row> 		               		
           	</p:panelGrid>           	           	
   			</p:panel>
   			
   			<p:dataTable id="coTec" style="width:750px" var="coTec" value="#{MBVaga.listaCTs}" emptyMessage="Nenhum conhecimento tecnológico exigido..." rowIndexVar="index" >
    		<p:column>    
        		<f:facet name="header">Nome do Conhecimento</f:facet>    
        		<h:outputText value="#{coTec.conhecimentotecnologico.nomeConhecTec}" />         
    		</p:column>   
    		<p:column>  
    		<div align="center">  
        		<p:commandButton icon="ui-icon-trash" title="Excluir" />    
        	</div> 
    		</p:column>    		     		    		      		     
   			</p:dataTable>
   			
   			<p:panel style="width:760px" header="PREFERENCIALMENTE ALUNOS DO CURSO"> 
		       <p:panelGrid styleClass="semBorda" style="width:740px">
   				<p:row>
               		<p:column colspan="4">
               			CURSO
               			<p:commandButton title="Pesquisar" icon="ui-icon-search" oncomplete="pesqCurso.show()" />
               		</p:column>
	            </p:row>              		               	
           	   </p:panelGrid>           	           	
   			</p:panel>
   			
   			<p:dataTable id="curso" var="curso" value="#{MBVaga.listaCursos}" emptyMessage="Curso Indiferente..." rowIndexVar="index" >
    		<p:column>    
        		<f:facet name="header">Nome do Curso</f:facet>    
        		<h:outputText value="#{curso.curso.nomeCurso}" />         
    		</p:column>   
    		<p:column>    
        		<p:commandButton icon="ui-icon-trash" title="Excluir" />     
    		</p:column>    		     		    		      		     
   			</p:dataTable>
   				   	
   			<p:panelGrid styleClass="semBorda" style="width:740px">
   			<p:row><p:column><p:commandButton value="GERAR VAGA" action="#{MBVaga.gerarVaga}" icon="ui-icon-disk" update="@form" /></p:column></p:row>
   			</p:panelGrid>
   			    
   			
    </p:panel>
      <p:dialog  widgetVar="pesqCT" modal="true" position="center" closable="true" height="500" width="800">
      <center>        	 
           <h:panelGrid id="PesqConhecTec">             
        		<h:outputText value="Nome do Conhecimento: " />  
            	<p:inputText value="#{MBVaga.nomeCT}" size="100"/>                        		 
        		<p:commandButton value="Confirmar" action="#{MBVaga.listarCT}" update="tbCT"/>
			    <p:dataTable id="tbCT" var="ct" value="#{MBVaga.listaPesqCTs}" paginator="true" rows="7" emptyMessage="Nenhum registro foi localizado...">    

  					<f:facet name="header">CONHECIMENTO TECNOLOGICO</f:facet>
	                                   
    				<p:column>    
        				<f:facet name="header">Cod.</f:facet>    
        				<h:outputText value="#{ct.codConhecTec}" />         
    				</p:column>    
                            
    				<p:column>        
        				<f:facet name="header">Nome</f:facet>                                
        				<h:outputText value="#{ct.nomeConhecTec}"/>    
    				</p:column>           				 
    
					<p:column>
      					<div align="center">         	           
        					<p:commandButton icon="ui-icon-plus" title="Selecionar" action="#{MBVaga.selecionarCT}" update="@form" oncomplete="pesqCT.hide()" />        			  
        				</div>
					</p:column>	         		                                          
				</p:dataTable>
			</h:panelGrid>
		</center>
 	</p:dialog> 	
 	 <p:dialog  widgetVar="pesqCurso" modal="true" position="center" closable="true" height="500" width="800">
      <center>        	 
           <h:panelGrid id="PCurso">             
        		<h:outputText value="Nome do Curso: " />  
            	<p:inputText value="#{MBVaga.nomeCurso}" size="100"/>                        		 
        		<p:commandButton value="Confirmar" action="#{MBVaga.listarCurso}" update="tbCurso"/>
			    <p:dataTable id="tbCurso" var="c" value="#{MBVaga.listaPesqCursos}" paginator="true" rows="7" emptyMessage="Nenhum registro foi localizado...">    

  					<f:facet name="header">CURSOS</f:facet>
	                                   
    				<p:column>    
        				<f:facet name="header">Cod.</f:facet>    
        				<h:outputText value="#{c.codCurso}" />         
    				</p:column>    
                            
    				<p:column>        
        				<f:facet name="header">Nome</f:facet>                                
        				<h:outputText value="#{c.nomeCurso}"/>    
    				</p:column>           				 
    
					<p:column>
      					<div align="center">         	           
        					<p:commandButton icon="ui-icon-plus" title="Selecionar" action="#{MBVaga.selecionarCurso}" update= "@form" oncomplete="pesqCurso.hide()" />        			  
        				</div>
					</p:column>	         		                                          
				</p:dataTable>
			</h:panelGrid>
		</center>
 	</p:dialog>
    <p:dialog  widgetVar="pesqCBO" modal="true" position="center" closable="true" height="500" width="800">
      <center>        	 
           <h:panelGrid id="PCBO">             
        		<h:outputText value="Nome do CBO: " />  
            	<p:inputText value="#{MBVaga.nomeCBO}" size="100"/>                        		 
        		<p:commandButton value="Confirmar" action="#{MBVaga.listarCBO}" update="tbCBO"/>
			    <p:dataTable id="tbCBO" var="cbo" value="#{MBVaga.listaPesqCBOs}" paginator="true" rows="7" emptyMessage="Nenhum registro foi localizado...">    

  					<f:facet name="header">CBO</f:facet>
	                                   
    				<p:column>    
        				<f:facet name="header">Cod.</f:facet>    
        				<h:outputText value="#{cbo.codCBO}" />         
    				</p:column>    
                            
    				<p:column>        
        				<f:facet name="header">Nome</f:facet>                                
        				<h:outputText value="#{cbo.descCBO}"/>    
    				</p:column>           				 
    
					<p:column>
      					<div align="center">         	           
        					<p:commandButton  title="Selecionar"  icon="ui-icon-check" action="#{MBVaga.selecionarCBO}" update= "@form" oncomplete="pesqCBO.hide()"/>        			  
        				</div>
					</p:column>	         		                                          
				</p:dataTable>
			</h:panelGrid>
		</center>
 	</p:dialog>                    
    </h:form>
    
    
</body> 
</html>
